<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

	<!-- blueprint CSS framework -->
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />
	<!--[if lt IE 8]>
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" media="screen, projection" />
	<![endif]-->

	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />

	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
</head>

<body>

<div class="container" id="page">

	<div id="header">
		<div id="logo"><?php echo CHtml::encode(Yii::app()->name); ?></div>
	</div><!-- header -->

	<div id="mainmenu">
		<?php 
		$this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'首页', 'url'=>array('/site/index')),

				array('label'=>'用户', 'url'=>array('/User/admin'), 'visible'=>(Yii::app()->user->getState('roles')==0&&!Yii::app()->user->isGuest)),

				array('label'=>'试题', 'url'=>array('/Questions/questions/admin'), 'visible'=>(Yii::app()->user->getState('roles')!=2&&!Yii::app()->user->isGuest)),
				array('label'=>'试卷', 'url'=>array('/Tests/tests/admin'), 'visible'=>(Yii::app()->user->getState('roles')!=2&&!Yii::app()->user->isGuest)),
				array('label'=>'考试', 'url'=>array('/Exams'), 'visible'=>(Yii::app()->user->getState('roles')!=2&&!Yii::app()->user->isGuest)),

				array('label'=>'参加考试', 'url'=>array('/Answers'), 'visible'=>(Yii::app()->user->getState('roles')==2&&!Yii::app()->user->isGuest)),
				array('label'=>'成绩管理', 'url'=>array('/Answers/default/sorce'), 'visible'=>(Yii::app()->user->getState('roles')==2&&!Yii::app()->user->isGuest)),
				
				array('label'=>'个人', 'url'=>array('/Users'), 'visible'=>(!Yii::app()->user->isGuest)),
				array('label'=>'介绍', 'url'=>array('/site/page', 'view'=>'about')),
				array('label'=>'留言', 'url'=>array('/site/contact')),
				array('label'=>'登录', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'退出 ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),
			),
		)); ?>
	</div><!-- mainmenu -->

	<?php $this->widget('zii.widgets.CBreadcrumbs', array(
		'homeLink'=>CHtml::link('首页',Yii::app()->homeUrl),
		'links'=>$this->breadcrumbs,
	)); ?><!-- breadcrumbs -->

	<?php echo $content;?>

	<div id="footer">
	<?php if(Yii::app()->name != 'YII DEMO'){?>
		Copyright &copy; <?php echo date('Y'); ?> by 北京南波教育社区.<br/>
	<?php }?>
		All Rights Reserved.<br/>
	</div><!-- footer -->

</div><!-- page -->

</body>
</html>